<template>
  	<div id="app">
		<Nav></Nav>
		<router-view ></router-view>
		<Footer></Footer>
  	</div>
</template>
<script>
	import {GetSetting} from '@/api/common'
	import Nav from './components/Nav'
	import Footer from '@c/Footer'
	export default {
		components :{
			Nav,
			Footer
		},
		mounted () {
			/* 
				生产环境，禁用鼠标右键和F12
			*/
			// if (process.env.NODE_ENV == 'production') {
			// 	document.oncontextmenu = (e) => {
			// 		let event = e || window.event || arguments.callee.caller.arguments[0]
			// 		event.returnValue = false;
			// 	}
			// 	document.onkeydown = document.onkeyup = document.onkeypress = (e) => {
			// 		let event = e || window.event || arguments.callee.caller.arguments[0]
			// 		if (e && e.keyCode == 123) {
			// 			e.returnValue = false;
			// 			return (false);
			// 		}
			// 	}
			// }
			
			if (window.innerWidth < 670) {
				this.$store.commit('changePlatfrom', false)
			} else {
				this.$store.commit('changePlatfrom', true)
			}


			window.onresize = (e) => {
				if (window.innerWidth < 670) {
					this.$store.commit('changePlatfrom', false)
				} else {
					this.$store.commit('changePlatfrom', true)
				}
			}
		},
		created () {
			GetSetting({}).then(res => {
				this.$store.commit('setSettings', res.result)
			})
		},
		methods : {
			
		}
	}
</script>

<style lang="less">
	//移动端
	@media screen and (max-width : 670px) {
		#app {
			padding-top: 60px;
		}
	}

	//pc端
	@media screen and (min-width : 670px) {
		#app {
			padding-top: 70px;
		}
		
	}
</style>